<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<script type="text/javascript">
	function jumpPage(pageNo) {
		$("#pageNo").val(pageNo);
		$("#mainForm").submit();
	}
	$(function(){
	
		$("#jumppage").click(function(){
			var nextpage=$("#jumppageno").val();
			var totalpages=$("#totalpages").val();
			if(isNaN(nextpage))
			{
				alert('提示：您输入的不是数字！');
				
			}else if(nextpage == 0){
				alert("提示：您输入的页码无效！");
				
			}else if(parseInt(nextpage) > parseInt(totalpages)){
				alert("提示：您输入的页码超过范围！");
				
			}else if(nextpage >0 && parseInt(nextpage) <= parseInt(totalpages)){
				jumpPage(nextpage);
			}
		});
	});
</script>
<div class="pageNo">
	<form id="jumpPage">
		<s:text name="page_no" />${page.pageNo}<s:text name="page_page" />&nbsp;&nbsp;&nbsp;<s:text name="page_total1" />${page.totalPages}<s:text name="page_page" />&nbsp;&nbsp;&nbsp;<s:text name="page_total2" />${page.totalCount}<s:text name="page_result" />&nbsp;&nbsp;&nbsp;
		<a href="javascript:jumpPage(1)"><s:text name="page_first" /></a>&nbsp;&nbsp;
		<s:if test="page.hasPre"><a href="javascript:jumpPage(${page.prePage})"><s:text name="page_pre" /></a>&nbsp;&nbsp;</s:if>
		<s:if test="page.hasNext"><a href="javascript:jumpPage(${page.nextPage})"><s:text name="page_next" /></a>&nbsp;&nbsp;</s:if>
		<a href="javascript:jumpPage(${page.totalPages})"><s:text name="page_last" /></a>&nbsp;&nbsp;							
		<input type="hidden" id="totalpages" value="${page.totalPages}"/>

		<s:text name="page_jump" /><input id="jumppageno"  type="text" size="3"></input><s:text name="page_page" /><input id="jumppage" class="button" 
		onmouseover="this.className='selectedButton'" onmouseout="this.className='button'" 
		type="button" value="Go"></input>
	</form>
</div>